Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

191
Visualizações
Django error: multiple default values for specified column "id"

I'm working with a project with docker-compose, where I have a postgre container.

When I run:

docker-compose -f dev.yml run django python manage.py migrate

I get the error:

django.db.utils.ProgrammingError: multiple default values specified for column "id" of table "scrapy_scrapy"

That is happening before I made some changes to my models.py file. But now the file is correct and should be working. This is the content of the models.py file:

from django.db import models
import django

# Create your models here.
class Scrapy(models.Model):
    user = models.CharField(max_length=50,blank=True)
    password = models.CharField(max_length=50,blank=True)
    projecte = models.CharField(max_length=100)
    estat_last_check = models.CharField(max_length=700, default="", blank=True)
    date = models.DateTimeField(default=django.utils.timezone.now, blank=True)

    app_label = ''
    def __str__(self):              # __unicode__ on Python 2
        return self.projecte + " - " + self.user

    class Meta:
        app_label = 'scrapy'

As you can see, no id filed is defined anymore, so, why is complaining about that field?

I've done my research and tried some possible solutions, but no luck. I've already tried deleting the full Docker container and creating it again, or trying to delete the database.

Any ideas?

about 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda